package cn.liuweiwei.mapper;

import cn.liuweiwei.domain.Blog;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface BlogMapper extends BaseMapper<Blog> {

    List<Blog> findBlogsByTitle(String title);

    Blog findOneBlogIdByTitle(String title);

    Blog findOneBlogById(String id);

    List<Blog> findBlogsByIds(List<String> ids);

    void updateViewCount(@Param("viewCount") Integer viewCount, String id);

    Integer selectViewCount(String id);

    Integer findBlogCountByTypeId(String id);

    List<Blog> findBlogsByTypeId(String id);

    List<Blog> orderBlogsByTime();

}
